using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class GameKeyListener : MonoBehaviour {
	
	//static Junk
//	private static KeyCode [] USABLE_KEYS =  {	
//		KeyCode.Q, KeyCode.W, KeyCode.E, KeyCode.R, KeyCode.T, KeyCode.Y, KeyCode.U, KeyCode.I, KeyCode.O, KeyCode.P, 
//		KeyCode.A, KeyCode.S, KeyCode.D, KeyCode.F, KeyCode.G, KeyCode.H, KeyCode.J, KeyCode.K, KeyCode.L, 
//		KeyCode.Z, KeyCode.X, KeyCode.C, KeyCode.V, KeyCode.B, KeyCode.N, KeyCode.M,
//		KeyCode.UpArrow, KeyCode.DownArrow, KeyCode.LeftArrow, KeyCode.RightArrow, KeyCode.Return, KeyCode.Space
//	};
	
	private static GameKeyListener _instance;
	
	public static GameKeyListener Instance {
	
		get{
			return _instance;
		}
		
		private set {
			_instance = value;
		}
		
	}
	
	void Awake(){
		Instance = this;	
	}
	
	// Class starts here
	
	private Dictionary<ControlSceme, InteractiveDisplay> _activeMenus = new Dictionary<ControlSceme, InteractiveDisplay>();
	
	public Dictionary<ControlSceme, InteractiveDisplay> ActiveMenus {
		get {
			return _activeMenus;
		}
		
	}
	
	void FixedUpdate() {
				
		foreach (KeyValuePair<ControlSceme, InteractiveDisplay>  ciPair in _activeMenus) {
			foreach (KeyCode k in ciPair.Key.Keys) {
				if (Input.GetKey(k)) {
					ciPair.Value.DoSomeThing(k, ciPair.Key);
				}
				
				
			}
		}		
	}
	
}
